<%@page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@page import="btsm.bean.sysPro"%>
<%@page import="com.yc.comm.Constant"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>  
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>智能资源管理--登录</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK href="Admin_Style.css" rel=stylesheet>
<SCRIPT language=javascript>
<!--
var closestr=0;
function SetFocus() {
if(document.Login.UserName.value == '')
  document.Login.UserName.focus();
else
  document.Login.UserName.select();
}
function CheckForm() {
  if(document.Login.UserName.value == '') {
    alert('请输入用户名！');
    document.Login.UserName.focus();
    return false;
  }
  if(document.Login.password.value == '') {
    alert('请输入密码！');
    document.Login.password.focus();
    return false;
  }
  
  return true;
}
//-->
</SCRIPT>
<style type="text/css">
<!--
.STYLE4 {
	color: #FFFFFF;
	font-size: 14pt;
	font-weight: bold;
}
-->
</style>
</HEAD>
<BODY style="overflow:hidden">
<%

	String errorMsg = "";
	try
	{
		errorMsg = session.getAttribute(Constant.LOGIN_ERROR_MSG).toString();
	}catch(Exception e)
	{
		errorMsg = "";
	}
			{
				sysPro sPro = new sysPro();
				String strBGPath =sPro.getLoginbk();
				if(strBGPath == null || strBGPath.equals(""))
					strBGPath = "images/login/loginbg.png";
%>
<form name="Login" method="post" onSubmit="return CheckForm();" action="check_user" target=_parent>
  <TABLE cellSpacing="0" cellPadding="0" width="784" background="<%=strBGPath%>" height="501" align="center" border="0" style="margin-top:100px;">
    <tr>
      <td height="236" colspan="2">      </td>
    </tr>
    <tr>
      <td width="39%" height="176"></td>
      <td width="61%" align="center">
      
      <table width="299">
      	 <tr>	 
      	 	<td colspan="2" height="22" align="center"> 
		      	<b><font color="red"><%=errorMsg %></font> </b></td>
      	 </tr>
          <tr>
		    <td width="78" align="right"><span class="STYLE4">用户名:</span></td>
            <td width="209" height="22" ><input name="UserName" id="UserName" type="text" size="25"></td>
          </tr>
		  		  
          <tr>
		    <td align="right"><span class="STYLE4">密码:</span></td>
            <td height="22"><input name="password" id="password"  type="password" size="27">
            	<input type="hidden" name="seraction" value="serlogin">			</td>
          </tr>
		  <tr>
		    <td align="right"><span class="STYLE4">随机码:</span></td>
            <td height="22">
				<input name="rand" id="randID" type="text" size="9">
				<img id="imgValidateCode" src="kaptcha.jpg" onClick="ChangeCode()" align="bottom"/></td>
          </tr>
          <tr>
            <td colspan="2" height="20" align="center"><input type="submit" value=" 登 录 ">&nbsp;&nbsp;&nbsp;
            	<input name="submit" type="reset" value=" 取 消 "></td>
          </tr>
        </table></td>
    </tr>
    <tr>
      <td height="89"></td>
      <td>&nbsp;</td>
    </tr>
  </TABLE>
</form>
<%
			}
%>
<SCRIPT language=JavaScript type=text/JavaScript>
function   ChangeCode()  
{  
	var   gNow   =   new   Date();  
	document.getElementById('imgValidateCode').src="kaptcha.jpg?x="+gNow.getSeconds();  
}   
SetFocus();
</SCRIPT>
</BODY>
</HTML>
